Yayin haɗin gwiwarmu, raba takaddun yana da mahimmanci ga ayyukanmu na yau da kullun, tabbatar da gogewa, takaddun haɗin kai yana da mahimmanci. Takardun kalmomi galibi ana yin zagaye na sake dubawa, tare da sharhi masu aiki azaman kayan aiki mai mahimmanci don amsawa da haɗin gwiwa. Koyaya, akwai lokacin da waɗannan maganganun (da farko masu mahimmanci), zasu iya rikitar da daftarin aiki kuma su hana karantawa. Bukatar cire tsokaci a cikin takaddar Kalma ba ta da tabbas; yana haɓaka bayanin daftarin aiki, yana daidaita tsarin gyarawa, kuma a ƙarshe yana samar da ƙarin ƙwararru da ƙayataccen samfurin ƙarshe. Wannan labarin yana nutsewa cikin buƙatu mai mahimmanci da tarin fa’idodi waɗanda ke zuwa tare da ingantaccen cire sharhi daga takaddun Kalma ta amfani da .NET REST API.
- API ɗin NET REST don cire sharhi a cikin Takardun Kalma
- Yadda ake Cire Comments a cikin Takardun Kalma ta amfani da C# .NET
- Share sharhi a cikin Takardun Kalma ta amfani da Umarnin CURL
API ɗin NET REST don cire sharhi a cikin Takardun Kalma
Aspose.Words Cloud SDK don NET kayan aiki ne mai ƙarfi wanda ke ba ku damar yin hulɗa tare da .NET REST API ba tare da wahala ba. Wannan SDK yana ba da hanya mai dacewa da shirye-shirye don haɗa ɗimbin kayan aikin da Aspose.Words Cloud ke bayarwa a cikin aikace-aikacen NET, yana ba da damar sarrafa takardu masu inganci da gudanarwa. Bugu da ƙari, idan ana batun cire tsokaci daga takaddun Word, yana ba da hanya madaidaiciya. Don haka, tare da taimakon hanyoyin da ayyuka masu dacewa da mai amfani, zaku iya samun damar aiki cikin sauƙi don share ko share sharhi daga takaddar Kalma.
Yanzu, da farko muna buƙatar bincika ‘Aspose.Words-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin ‘Ƙara Kunshin’. Wannan zai ƙara bayanin Cloud SDK a cikin aikace-aikacen NET. Bugu da ƙari, muna kuma buƙatar ziyartar dashboard Cloud, don samun keɓaɓɓen takaddun shaidar abokin ciniki.
Yadda ake Cire Comments a cikin Takardun Kalma ta amfani da C# .NET
Da fatan za a bi umarnin da aka kayyade a ƙasa don share sharhi a cikin takaddar Word ta amfani da snippet code C# .NET.
// Don cikakkun misalai da fayilolin bayanai, da fatan za a je zuwa
https://github.com/aspose-words-cloud/aspose-words-cloud-dotnet
// Samu bayanan abokin ciniki daga https://dashboard.aspose.cloud/
string clientSecret = "c71cfe618cc6c0944f8f96bdef9813ac";
string clientID = "163c02a1-fcaa-4f79-be54-33012487e783";
// ƙirƙiri abin daidaitawa ta amfani da ID na Abokin ciniki da bayanan Sirrin Abokin ciniki
var config = new Configuration { ClientId = clientID, ClientSecret = clientSecret };
// fara misali WordsApi
var wordsApi = new WordsApi(config);
// loda fayil ɗin daga rumbun gida
using (var file = System.IO.File.OpenRead("finaloutput.doc"))
{
// ƙirƙirar buƙatar loda fayil
var uploadFileRequest = new UploadFileRequest(file, "sourceFile.doc");
// loda fayil zuwa ma'ajiyar Cloud
wordsApi.UploadFile(uploadFileRequest);
}
// ƙirƙiri misali share buƙatun sharhi
DeleteCommentsOnlineRequest deleteComments = new DeleteCommentsOnlineRequest(document: file);
// kira API don cire duk tsokaci daga takardun Kalma
var result = wordsApi.DeleteCommentsOnline(deleteComments);
An bayar a ƙasa shine bayanin game da snippet code da aka bayyana a sama.
var config = new Configuration { ClientId = clientID, ClientSecret = clientSecret };
WordsApi wordsApi = new WordsApi(config);
Da farko, fara misalin ajin ‘WordsApi’ yayin wuce abin ‘Configuration’ azaman hujja.
var uploadFileRequest = new UploadFileRequest(file, "sourceFile.doc", storageName: "default");
wordsApi.UploadFile(uploadFileRequest);
Loda daftarin aiki na Word zuwa ma’ajiyar gajimare.
DeleteCommentsOnlineRequest deleteComments = new DeleteCommentsOnlineRequest(document: file);
Ƙirƙiri misalin neman ShareComments inda muka wuce sunan shigar da takaddar Kalma mai ɗauke da tsokaci azaman hujja.
wordsApi.DeleteCommentsOnline(deleteComments);
Kira API don cire tsokaci a cikin takaddar Kalma.
Share sharhi a cikin Takardun Kalma ta amfani da Umarnin CURL
Yin amfani da Aspose.Words Cloud a haɗe tare da umarnin cURL don share tsokaci daga takaddun Kalma yana ba da fa’idodi masu ban sha’awa. Na farko kuma mafi mahimmanci, wannan hanyar ita ce mai zaman kanta mai zaman kanta kuma tana da matukar dacewa, yana ba da damar haɗin kai ba tare da la’akari da tsarin aiki ko yanayin ci gaba da ake amfani da shi ba. Sauƙi da samun damar umarnin cURL suna sa tsarin ya zama mai aminci, yana buƙatar saiti kaɗan da ba da damar aiwatarwa cikin sauri.
Mataki na farko shine aiwatar da umarni mai zuwa don samar da alamar shiga JWT:
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=163c02a1-fcaa-4f79-be54-33012487e783&client_secret=c71cfe618cc6c0944f8f96bdef9813ac" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
Da zarar mun sami alamar JWT, da fatan za a aiwatar da wannan umarni don share duk maganganun da aka yi daga takaddar Word.
curl -v "https://api.aspose.cloud/v4.0/words/online/delete/comments" \
-X PUT \
-H "Authorization: Bearer {accessToken}" \
-H "Content-Type: multipart/form-data" \
-F Document="@{sourceFile}"
Sauya ‘sourceFile’ tare da sunan shigarwar daftarin aiki na Kalma mai ɗauke da sharhi, ‘accessToken’ tare da alamar samun damar JWT da aka samar a sama.
Kammalawa
A ƙarshe, ikon sarrafa yadda ya kamata da cire sharhi daga takaddun Word wani muhimmin al’amari ne na kiyaye tsabta da ƙwarewa a cikin gyaran takardu. Mun bincika hanyoyi biyu masu tasiri a cikin wannan yunƙurin: yin amfani da Aspose.Words Cloud SDK don NET da kuma amfani da Aspose.Words Cloud tare da umarnin cURL. Duk hanyoyin biyu suna haifar da sakamako iri ɗaya: yadda ya kamata cire sharhi daga takaddun Word. Ko zaɓin sophistication na SDK ko sauƙi na umarnin cURL, sakamakon yana haɓaka iya karatun daftarin aiki da ingantaccen ƙwarewar gyarawa.
A kowane hali, hanyoyin biyu suna cimma burin sarrafa sharhi, ƙarfafa masu amfani don sadar da goge, takaddun ƙwararru.
Hanyoyin haɗi masu amfani
Labarai masu alaka
Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: